#ifndef __FIO_BUFFER_H
#define __FIO_BUFFER_H

#include <pthread.h>
#include "ft_fifo.h"

struct fio_info {
	int                   fd;
	struct ft_fifo        *fifo;
	pthread_t             thread;
	pthread_mutex_t       start_write_lock;
	pthread_mutex_t       end_write_lock;
	pthread_cond_t        start_wcond;
	pthread_cond_t        end_wcond;
	volatile unsigned int status;
};

extern void fio_trigger_write(struct fio_info *io_info);
extern void fio_wait_write_stop_and_pending(struct fio_info *io_info);
extern ssize_t fio_write(struct fio_info *io_info, const void *buf, size_t count);
extern struct fio_info *fio_alloc(void);
extern void fio_free(struct fio_info *io_info);

#endif /* __FIO_BUFFER_H */
